﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleRest.Serialization.Xsd
{
    public class ComplexType
    {
        public ComplexType(){
            this.DefaultXmlNamespace = "xs";
        }
        public string Name { get; set; }
        public IEnumerable<Element> Elements { get; set; }
        public string DefaultXmlNamespace{get;set;}
        public bool IsElement{get;set;}

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<").Append(this.DefaultXmlNamespace).Append(":complexType>\n");
            sb.Append("<").Append(this.DefaultXmlNamespace).Append(":sequence>\n");
            if (this.Elements != null)
                foreach (var element in this.Elements)
                    sb.Append(element.ToString() + "\n");

            return sb.ToString();
        }
    }
}
